import FileSlicingObject from './index'
import FileSlicingFile from './fileSlicingFile'
import Indexdb from './indexdb'
import Subject from './subject'
import Observers from './observers'
import Vnode from './vnode'
import FlieDispose from './flieDispose'


//工厂类
export default class FileSlicingObjectFactory {
    createObject(type, data) {
        switch (type) {
            case 'FileSlicingObject':
                return FileSlicingObject.getInstance(...data);
                break;
            case 'FileSlicingFile':
                return new FileSlicingFile(...data)
                break;
            case 'Indexdb':
                return new Indexdb(...data)
                break;
            case 'Subject':
                return new Subject()
                break;
            case 'Observers':
                return new Observers(...data)
                break;
            case 'Vnode':
                return new Vnode(...data)
                break;
            case 'FlieDispose':
                return new FlieDispose(...data)
                break;
            default:
                return new Error('工厂无此对象')
                break;
        }
    }
}